From b4b185d53dab09ce50dab2f95fa109f385c37db2 Mon Sep 17 00:00:00 2001 From: vanadiae Date: Thu, 24 Feb 2022 23:04:20 +0100 Subject: [PATCH] builder: Clarify default "swapped" value when "object" is set for signals I encountered this issue where I casted user_data to my self type, but it showed me they were actually swapped when I set the "object" signal attribute. After checking the source code which confirms this, it is a good idea to properly document that convenient behaviour. --- gtk/gtkbuilder.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index 545699c45c..8b29eff605 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -153,9 +153,10 @@ * specifies the function to connect to the signal. * The remaining attributes, “after”, “swapped” and “object”, have the * same meaning as the corresponding parameters of the - * g_signal_connect_object() or g_signal_connect_data() functions. A - * “last_modification_time” attribute is also allowed, but it does not - * have a meaning to the builder. + * g_signal_connect_object() or g_signal_connect_data() functions. By + * default "swapped" will be set to "yes" if not specified otherwise, in the + * case where "object" is set, for convenience. A “last_modification_time” + * attribute is also allowed, but it does not have a meaning to the builder. * * If you rely on `GModule` support to lookup callbacks in the symbol table, * the following details should be noted: -- 2.30.2